/**
 * 窗口中居中显示选中的对象，但是会移动对象到一个容器中
 */
(function($, undefined) {
	$.fn.centerShow = function(options) {
		var $obj = $(this);
		var width = $obj.outerWidth(true);
		var height = $obj.outerHeight(true);
		if ($.browser.msie && $.browser.version == "6.0") {
			$obj.css({
						"position" : "absolute",
						"display" : "block",
						visibility : "visible"
					});

			$.fn.centerShow.setPos();
			$(window).resize(function() {
						$.fn.centerShow.setPos($obj);
					}).scroll(function() {
						$.fn.centerShow.setPos($obj);
					});
		} else {

			$obj.css({
						"position" : "fixed"
					});
			$.fn.centerShow.setPos($obj);
		}
	};

	$.fn.centerShow.setPos = function($obj) {
		
		var width = $obj.outerWidth(true);
		var height = $obj.outerHeight(true);
		$obj.css({
					"left" : Math.floor(($(window).width() - width) / 2),
					"top" : Math.floor(($(window).height() - height) / 2)
							+ $(window).scrollTop()
				});
	};

	$.fn.centerShow.defaults = {

	};

})(jQuery);